package pl.bristleback.bindingsample;

import org.apache.log4j.Logger;
import org.jwebsocket.factory.JWebSocketFactory;

import java.util.Scanner;

/**
 * Main class of Bristle Binding Demo standalone application.
 * <p/>
 * Created on: 2011-03-22 23:30:14 <br/>
 *
 * @author Wojciech Niemiec
 */
public class BindingDemo {
  private static Logger log = Logger.getLogger(BindingDemo.class.getName());

  private static final char STOP_CHAR = 'x';

  public static void main(String[] args) {
    JWebSocketFactory.start("/absolute_path/jwebsocket.xml");

    Scanner in = new Scanner(System.in);
    boolean continueWork = true;
    while (continueWork) {
      System.out.print("Press 'x' to close server ");
      String c = in.next();
      if (STOP_CHAR == c.charAt(0)) {
        continueWork = false;
      }
    }
    JWebSocketFactory.stop();
  }

}
